/**
 *    Copyright (C) 2008, 2009  Victor Smirnov <aist11@gmail.com>
 *
 *    This program is free software; you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation; either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License along
 *    with this program; if not, write to the Free Software Foundation, Inc.,
 *    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 *    See LICENSE.exceptions in the root folder of this project for possible
 *    exceptions
 *
 */

#include <cubefs/core/api/api.hpp>

#define CUBEFS_SOURCE "cubefs/core/api-impl/all/models.cpp:" CUBEFS_AT

namespace cubefs { namespace api {



DefaultLogHandler* coutLogHandler;

DefaultLogHandler* GetDefaultLogHandler() {
	return coutLogHandler;
}

CUBEFS_DEFINE_REFLECTION_TYPE(InputStreamHandler, 	InputStreamHandlerImpl);
CUBEFS_DEFINE_REFLECTION_TYPE(OutputStreamHandler, 	OutputStreamHandlerImpl);
CUBEFS_DEFINE_REFLECTION_TYPE(LogHandler, 			LogHandlerImpl);
CUBEFS_DEFINE_REFLECTION_TYPE(Logger, 				LoggerImpl);
CUBEFS_DEFINE_REFLECTION_TYPE(Iterator, 			IteratorImpl);
CUBEFS_DEFINE_REFLECTION_TYPE(TreeMapIterator, 		TreeMapIteratorImpl);
CUBEFS_DEFINE_REFLECTION_TYPE(IdxMapIterator, 		IdxMapIteratorImpl);
CUBEFS_DEFINE_REFLECTION_TYPE(Container, 			ContainerImpl);
CUBEFS_DEFINE_REFLECTION_TYPE(Data, 				DataImpl);
CUBEFS_DEFINE_REFLECTION_TYPE(Model, 				ModelImpl);
CUBEFS_DEFINE_REFLECTION_TYPE(Manager, 				ManagerImpl);
CUBEFS_DEFINE_REFLECTION_TYPE(StreamManager, 		StreamManagerImpl);
CUBEFS_DEFINE_REFLECTION_TYPE(DataIterator, 		DataIteratorImpl);
CUBEFS_DEFINE_REFLECTION_TYPE(BlobMapIterator, 		BlobMapIteratorImpl);
CUBEFS_DEFINE_REFLECTION_TYPE(DynVector, 			DynVectorImpl);
CUBEFS_DEFINE_REFLECTION_TYPE(BlobMap, 				BlobMapImpl);
CUBEFS_DEFINE_REFLECTION_TYPE(CTreeLabel, 			CTreeLabelImpl);
CUBEFS_DEFINE_REFLECTION_TYPE(CTreePathSet, 		CTreePathSet);
CUBEFS_DEFINE_REFLECTION_TYPE(Collection, 			CollectionImpl);
//CUBEFS_DEFINE_REFLECTION_TYPE(Container, 			ContainerImpl);
CUBEFS_DEFINE_REFLECTION_TYPE(Map::Pair, 			PairImpl);
CUBEFS_DEFINE_REFLECTION_TYPE(Map, 					MapImpl);
CUBEFS_DEFINE_REFLECTION_TYPE(TreeMap, 				TreeMapImpl);
CUBEFS_DEFINE_REFLECTION_TYPE(IdxMap, 				IdxMapImpl);

void InitModels() {

	coutLogHandler = new DefaultLogHandlerImpl();

    InputStreamHandlerImpl::Init();
    OutputStreamHandlerImpl::Init();

    LogHandlerImpl::Init();
    DefaultLogHandlerImpl::Init();
    LoggerImpl::Init();

    ManagerImpl::Init();
    StreamManagerImpl::Init();

    IteratorImpl::Init();
    TreeMapIteratorImpl::Init();
    IdxMapIteratorImpl::Init();

    ContainerImpl::InitType();

    DataImpl::Init();

    ModelImpl::Init();

    DataIteratorImpl::Init();
    BlobMapIteratorImpl::Init();

    DynVectorImpl::Init();
    BlobMapImpl::Init();

    CTreeLabelImpl::Init();
    CTreePathSetImpl::Init();
    CTreeImpl::Init();

    CollectionImpl::Init();

    //PageImpl::Init();

    PairImpl::Init();
    MapImpl::Init();

    TreeMapImpl::Init();

    IdxMapImpl::Init();

    ContainerImpl::InitOperations();
}

}}

#undef CUBEFS_SOURCE
